package com.lichunsheng.stu.service.impl;

import com.lichunsheng.stu.dao.PeUserDao;
import com.lichunsheng.stu.entity.PeUser;
import com.lichunsheng.stu.service.PeUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

@Service
public class PeUserServiceImpl implements PeUserService {
    @Autowired
    private PeUserDao peUserDao;

    /*
     * 根据名称查询用户
     * */
    @Override
    public PeUser findByUserName(String username) {
        Example example = new Example(PeUser.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("username", username);
        PeUser peUser = peUserDao.selectOneByExample(example);
        return peUser;
    }


}
